<template>
    <div>
        <br>
        <!--<Row>
            <Modal width="960"
                   v-model="modalZy"
                   :mask-closable="false"
                   title="请选择你喜欢的专业"
                   :styles="{top: '20px'}"
            >

                <Row>
                    <Tabs value="name1">
                        <TabPane label="本科专业列表" name="name1">
                            <CheckboxGroup v-model="checkAllGroup" @on-change="changeGroup">
                                <Row class-name="zyCol" type="flex" style="height:40px" align="middle" justify="center">

                                    <Col span="2">
                                    <Checkbox label="01">哲学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="02">经济学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="03">法学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="04">教育学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="05">文学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="06">历史学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="07">理学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="08">工学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="09">农学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="10">医学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="12">管理学</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="13">艺术学</Checkbox>
                                    </Col>

                                </Row>
                            </CheckboxGroup>
                            <div v-for="(item, index) in oneItems">
                                <Row style="margin-top: 10px">
                                    <Col span="24">
                                    <Checkbox :indeterminate="item.indeterminate"
                                              :value="item.checkAll"
                                              @click.prevent.native="handleCheckAll(index)">
                                        <span style="font-size: 18px">{{item.value}}</span>
                                    </Checkbox>
                                    </Col>
                                </Row>
                                <div v-for="(twoItem, twoIndex) in item.twoItems">
                                    <Row style="margin-top: 10px">
                                        <Col style="background:#101646;">
                                        <CheckboxGroup v-model="item.twoItemCheck">
                                            <Checkbox :label="twoItem.label" :indeterminate="twoItem.indeterminate"
                                                      :value="twoItem.checkAll"
                                                      @click.prevent.native="handleCheckAllTwo(index,twoIndex)">
                                                <span style="font-size: 14px">{{twoItem.value}}</span>
                                            </Checkbox>
                                        </CheckboxGroup>
                                        </Col>
                                    </Row>
                                    <Row style="margin-top: 10px">
                                        <Col v-for="(threeItem, threeIndex) in twoItem.threeItems" span="4">
                                        <CheckboxGroup v-model="twoItem.threeItemCheck"
                                                       @on-change="checkAllGroupChange(index,twoIndex,threeIndex)">
                                            <Checkbox :value="threeItem.checkAll"
                                                      :label="threeItem.label">
                                                <span style="font-size: 14px">{{threeItem.value}}</span>
                                            </Checkbox>
                                        </CheckboxGroup>
                                        </Col>
                                    </Row>
                                </div>
                            </div>

                        </TabPane>
                        <TabPane label="专科专业列表" name="name2">
                            <CheckboxGroup v-model="checkAllGroup1" @on-change="changeGroup1">
                                <Row class-name="zyCol" type="flex" style="height:40px" align="middle" justify="center">

                                    <Col span="2">
                                    <Checkbox label="54">土建</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="55">水利</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="57">生化</Checkbox>
                                    </Col>
                                    <Col span="3">
                                    <Checkbox label="63">财经</Checkbox>
                                    </Col>
                                    <Col span="3">
                                    <Checkbox label="64">旅游</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="58">轻纺</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="51">农林牧渔</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="56">装备制造</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="60">交通运输</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="61">电子信息</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="62">医药卫生</Checkbox>
                                    </Col>

                                </Row>
                                <Row class-name="zyCol" type="flex" style="height:40px" align="middle" justify="center">
                                    <Col span="2">
                                    <Checkbox label="65">文化艺术</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="66">新闻传播</Checkbox>
                                    </Col>
                                    <Col span="2">
                                    <Checkbox label="68">公安司法</Checkbox>
                                    </Col>
                                    <Col span="3">
                                    <Checkbox label="52">资源与安全</Checkbox>
                                    </Col>
                                    <Col span="3">
                                    <Checkbox label="67">教育与体育</Checkbox>
                                    </Col>
                                    <Col span="4">
                                    <Checkbox label="53">能源动力与材料</Checkbox>
                                    </Col>
                                    <Col span="4">
                                    <Checkbox label="59">食品药品与粮食</Checkbox>
                                    </Col>
                                    <Col span="4">
                                    <Checkbox label="69">公共管理与服务</Checkbox>
                                    </Col>

                                </Row>
                            </CheckboxGroup>
                            <div v-for="(item, index) in oneItems1">
                                <Row style="margin-top: 10px">
                                    <Col span="24">
                                    <Checkbox :indeterminate="item.indeterminate"
                                              :value="item.checkAll"
                                              @click.prevent.native="handleCheckAll1(index)">
                                        <span style="font-size: 18px">{{item.value}}</span>
                                    </Checkbox>
                                    </Col>
                                </Row>
                                <div v-for="(twoItem, twoIndex) in item.twoItems">
                                    <Row style="margin-top: 10px">
                                        <Col style="background:#101646;">
                                        <CheckboxGroup v-model="item.twoItemCheck">
                                            <Checkbox :label="twoItem.label" :indeterminate="twoItem.indeterminate"
                                                      :value="twoItem.checkAll"
                                                      @click.prevent.native="handleCheckAllTwo1(index,twoIndex)">
                                                <span style="font-size: 14px">{{twoItem.value}}</span>
                                            </Checkbox>
                                        </CheckboxGroup>
                                        </Col>
                                    </Row>
                                    <Row style="margin-top: 10px">
                                        <Col v-for="(threeItem, threeIndex) in twoItem.threeItems" span="4">
                                        <CheckboxGroup v-model="twoItem.threeItemCheck"
                                                       @on-change="checkAllGroupChange1(index,twoIndex,threeIndex)">
                                            <Checkbox :value="threeItem.checkAll"
                                                      :label="threeItem.label">
                                                <span style="font-size: 14px">{{threeItem.value}}</span>
                                            </Checkbox>
                                        </CheckboxGroup>
                                        </Col>
                                    </Row>
                                </div>
                            </div>

                        </TabPane>

                    </Tabs>

                </Row>
                <div slot="footer">
                    <Button type="primary" size="large" @click="modalZyClick" long>确定</Button>
                </div>
            </Modal>
            {{searchZy}}
            <Button icon="plus-circled" type="dashed" size="small" @click="modalZy = true">设置专业</Button>
        </Row>-->

        <MajorSelect v-model="majorData" @change="selectChange"></MajorSelect>
        <br>
        <i-Switch v-model="smartRecommend" @on-change="change"></i-Switch>
        开启智能推荐
        <RadioGroup v-model="button1" @on-change="change1" type="button">
            <Radio label="保底"></Radio>
            <Radio label="适合"></Radio>
            <Radio label="风险"></Radio>
            <Radio label="冲刺"></Radio>
        </RadioGroup>
        <br>
        <Tabs @on-click="tableChange()" v-model="queryMethod" :animated="false">
            <TabPane label="线差法/位次法/系数法" name="xianCha">
                <br>
                <Row :gutter="10">
                    <Col :span="3">

                    线差平均值-阈值:<span class="yuzhi">{{condition.xianca}}</span></Col>
                    <Col :span="8">
                    <Slider v-model="condition.xianca" :min="-10" :max="10"
                            :disabled="smartRecommend" @on-change="xianchaChangeSlider"></Slider>
                    </Col>
                    <Col :span="3">
                    <Tooltip content="线差法:说明文字" placement="top">
                        <Button type="primary" shape="circle">i</Button>
                    </Tooltip>
                    </Col>
                </Row>


                <br>
                <Checkbox v-model="condition.weiCi.useTonFen">使用同分排名、使用累计排名</Checkbox>
                <br> <br>
                <Row :gutter="10">

                    <Col :span="3">
                    最低分排名-阈值:<span class="yuzhi">{{condition.weiCi.diFen}}</span></Col>
                    <Col :span="8">
                    <Slider v-model="condition.weiCi.diFen" :min="-100" :max="100" :disabled="smartRecommend"
                            @on-change="weiciChangeSlider"></Slider>
                    </Col>
                    <Col :span="3">
                    <Tooltip content="位次法:说明文字" placement="top">
                        <Button type="primary" shape="circle">i</Button>
                    </Tooltip>
                    </Col>
                </Row>

                <br>
                <Row :gutter="10">
                    <Col :span="3">
                    系数平均值-阈值:<span class="yuzhi">{{condition.xiShu}}</span></Col>
                    <Col :span="8">
                    <Slider v-model="condition.xiShu" :min="0" :max="10"
                            :disabled="smartRecommend" :tip-format="format" @on-change="xishuChangeSlider"></Slider>
                    </Col>
                    <Col :span="3">
                    <Tooltip content="类比法:说明文字" placement="top">
                        <Button type="primary" shape="circle">i</Button>
                    </Tooltip>
                    </Col>
                </Row>
            </TabPane>
            <TabPane label="类比法" name="leiBi">
                <Row>
                    <Col :span="3">
                    历史与我同分数:</Col>
                    <Col :span="8">
                    <CheckboxGroup @on-change="lbScoreChangeSilder" v-model="condition.leiBi.tongFen">
                        <Checkbox label="2017"></Checkbox>
                        <Checkbox label="2016"></Checkbox>
                        <Checkbox label="2015"></Checkbox>
                    </CheckboxGroup>
                    </Col>
                </Row>
                <Row>
                    <Col :span="3">
                    历史与我同名次:</Col>
                    <Col :span="8">
                    <CheckboxGroup @on-change="lbPmChangeSilder" v-model="condition.leiBi.tongMing">
                        <Checkbox label="2017"></Checkbox>
                        <Checkbox label="2016"></Checkbox>
                        <Checkbox label="2015"></Checkbox>
                    </CheckboxGroup>
                    </Col>
                </Row>
                <br>
            </TabPane>
        </Tabs>
        <Row :gutter="10">

            <Col :span="8" style="display: none">
            <Cascader :load-data="loadData" @on-change="searchChange" change-on-select :data="condition.filter.data"
                      v-model="condition.filter.value2"></Cascader>
            </Col>
            <Col :span="4">
            <Select @on-change="searchChange1" v-model="condition.filter.type" style="width:200px">
                <Option v-for="item in condition.filter.typeList" :value="item.value" :key="item.value">{{ item.label
                    }}
                </Option>
            </Select></Col>

        </Row>
        <Card :padding="5" style="text-align: center">
            新增排名信息<br>
        </Card>
        <br>
        <Row :gutter="10">
            <Col :span="12" v-for="major in majorList">
            <Card>
                <Row>
                    <Col :span="6">
                    <H2>
                        <a @click="addToFavorite(major)">
                            <Icon :type="major.isFavorite?'android-star':'android-star-outline'"></Icon>
                        </a>
                    </H2>
                    <H4 :class="major.className">{{major.martichSchoolName}}</H4>
                    <ul>
                        <li>{{major.batchName}}</li>
                        <li>{{major.wlType}}</li>
                        <li>{{major.professionName}}</li>
                    </ul>
                    </Col>
                    <Col :span="18">

                    <Table size="small" border :columns="admitHistoryColumn" :data="major.admitHistory"></Table>
                    </Col>
                </Row>
            </Card>

            </Col>

        </Row>
        <Row>
            <Card align="center">
                <Page :total="condition.total" @on-page-size-change="pageSizeChange" @on-change="pageChange"
                      :page-size="condition.pageSzie" :current="condition.current" show-total show-sizer></Page>
            </Card>
        </Row>

    </div>
</template>
<script>
    import {exam} from '../../../../../api/index.js';
    import Row from "iview/src/components/grid/row";
    import MajorSelect from "./major-select.vue";

    export default {
        components: {Row, MajorSelect},
        data() {
            return {

                selectMajorModal: false,//选择专业modal

                showMajor: {},
                modalZy: false,
                searchZy: "",
                searchZyId: "",
                model1: "",
                button1: "适合",
                smartRecommend: true,
                status: true,
                oneItems: [],
                oneItems1: [],
                condition: {
                    total: 0,
                    current: 1,
                    pageSzie: 20,
                    xianCha: 0,
                    xianca: 0,
                    weiCi: {
                        useTonFen: true,
                        gaoFen: 0,
                        diFen: 0
                    },
                    xiShu: 0,
                    leiBi: {
                        tongFen: [],
                        tongMing: [],
                    },
                    filter: {
                        type: "",
                        typeList: [
                            {
                                value: "",
                                label: "全部"
                            },
                            {
                                value: "985",
                                label: "985工程"
                            }, {
                                value: "211",
                                label: "211工程"
                            }, {
                                value: "not211",
                                label: "非985/211工程"
                            }
                        ],
                        searchType: "0",
                        searchValue: "",
                        value2: [],
                        data: [{
                            value: 'BK',
                            label: '本科',
                            children: [],
                            loading: false
                        }, {
                            value: 'ZK',
                            label: '专科',
                            children: [],
                            loading: false
                        }],
                        batch: "",
                        collegeType: "",
                        enrollPercent: "",
                        range: "",
                        area: "",
                    }
                },
                queryMethod: "xianCha",
                checkAllGroup: [],
                checkAllGroup1: [],
                allGroup: [],
                admitHistoryColumn: [
                    {
                        title: '年份',
                        key: 'year'
                    },
                    {
                        title: '最高分',
                        key: 'bigScore'
                    },
                    {
                        title: '最高排名',
                        key: 'bigPm'
                    },
                    {
                        title: '最低分',
                        key: 'smallScore'
                    },
                    {
                        title: '最低排名',
                        key: 'smallPm'
                    }
                ],
                majorList: [],
                majorData: {//TODO 获取服务端专业数据
                    name: "哲学",
                    subMajors: [{
                        name: "哲学二级-1",
                        subMajors: [
                            {name: "哲学三级1"}, {name: "哲学三级2"}
                        ]
                    }, {
                        name: "哲学二级-2",
                        subMajors: [
                            {name: "哲学三级11"}, {name: "哲学三级22"}
                        ]
                    }, {
                        name: "哲学二级-311",
                        subMajors: [
                            {name: "哲学三级111"}, {name: "哲学三级222"}
                        ]
                    }]
                }
            }
        },
        methods: {
            selectChange(data) {
                console.log(data);
            },

            selectMajor(majorName) {
                this.selectMajorModal = true;
                this.showMajor = {majorName: majorName, subMajors: this.majors[majorName]};
            },
            showload() {
                this.$Spin.show({
                    render: (h) => {
                        return h('div', [
                            h('Icon', {
                                'class': 'demo-spin-icon-load',
                                props: {
                                    type: 'load-c',
                                    size: 18
                                }
                            }),
                            h('div', 'Loading')
                        ])
                    }
                });
            },
            /*modalZyClick() {
                this.modalZy = false;

                var str = "";

                if (this.oneItems != undefined) {
                    for (var i = 0; i < this.oneItems.length; i++) {
                        for (var j = 0; j < this.oneItems[i].twoItems.length; j++) {
                            for (var k = 0; k < this.oneItems[i].twoItems[j].threeItemCheck.length; k++) {
                                str += this.oneItems[i].twoItems[j].threeItemCheck[k] + ",";
                            }
                        }
                    }
                }
                var str1 = "";
                if (this.oneItems1 != undefined) {
                    for (var i = 0; i < this.oneItems1.length; i++) {
                        for (var j = 0; j < this.oneItems1[i].twoItems.length; j++) {
                            for (var k = 0; k < this.oneItems1[i].twoItems[j].threeItemCheck.length; k++) {
                                str1 += this.oneItems1[i].twoItems[j].threeItemCheck[k] + ",";
                            }
                        }
                    }
                }
                if (str != "" && str1 != "") {
                    str = str + str1.substring(0, str1.length - 1);
                } else {
                    if (str != "") {
                        str = str.substring(0, str.length - 1);
                    } else if (str1 != "") {
                        str = str1.substring(0, str1.length - 1);
                    }
                }
                console.info(str);
                this.searchZyId = str;
                this.xianchaChange(this.condition.xianca, this.condition.xianca, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },*/
            loadData(item, callback) {

                if (item.__value.split(",").length == 1) {
                    item.loading = true;
                    exam.getSearch_post({"data": {"type": item.value}}).then((res) => {
                        item.children = res.data.data.list;
                        item.loading = false;
                        callback();
                    }, function (error) {
                        alert("系统异常，请先联系管理员");
                    });
                } else if (item.__value.split(",").length == 2) {
                    item.loading = true;
                    exam.getSearch1_post({"data": {"type": item.value}}).then((res) => {
                        item.children = res.data.data.list;
                        item.loading = false;
                        callback();
                    }, function (error) {
                        alert("系统异常，请先联系管理员");
                    });
                } else if (item.__value.split(",").length == 3) {
                    item.loading = true;
                    exam.getSearch2_post({"data": {"type": item.value}}).then((res) => {
                        item.children = res.data.data.list;
                        item.loading = false;
                        callback();
                    }, function (error) {
                        alert("系统异常，请先联系管理员");
                    });
                } else if (item.__value.split(",").length == 4) {
                    callback();
                }

            },
            format(val) {
                return val / 100;
            },
            xianchaChange(fz1, fz2, pageNum, pageSize, search1) {
                this.majorList = [];
                this.condition.total = 0;
                if (this.status == true) {
                    if (this.queryMethod == "xianCha") {
                        if (this.button1 == "保底") {
                            fz1 = 5;
                            fz2 = 10;
                        } else if (this.button1 == "适合") {
                            fz1 = 0;
                            fz2 = 5;
                        } else if (this.button1 == "风险") {
                            fz1 = -5;
                            fz2 = 0;
                        }
                        else if (this.button1 == "冲刺") {
                            fz1 = -10;
                            fz2 = -5;
                        }
                        exam.getVolByXc_post({
                            "data": {
                                "fz1": fz1,
                                "fz2": fz2,
                                "pageNum": pageNum,
                                "pageSize": pageSize,
                                "search1": search1,
                                "searchType": this.condition.filter.searchType,
                                "searchValue": this.condition.filter.searchValue,
                                "searchZy": this.searchZyId
                            }
                        }).then((res) => {
                            this.majorList = res.data.data.mntbList;

                            this.condition.total = res.data.data.count;
                        }, function (error) {
                            alert("系统异常，请先联系管理员");
                        });
                    } else if (this.queryMethod == "weiCi") {
                        if (this.button1 == "保底") {
                            fz1 = 1000;
                            fz2 = 2000;
                        } else if (this.button1 == "适合") {
                            fz1 = 0;
                            fz2 = 1000;
                        } else if (this.button1 == "风险") {
                            fz1 = -1000;
                            fz2 = 0;
                        }
                        else if (this.button1 == "冲刺") {
                            fz1 = -2000;
                            fz2 = -1000;
                        }
                        exam.getVolByPm_post({
                            "data": {
                                "fz1": fz1,
                                "fz2": fz2,
                                "pageNum": pageNum,
                                "pageSize": pageSize,
                                "search1": search1,
                                "searchType": this.condition.filter.searchType,
                                "searchValue": this.condition.filter.searchValue,
                                "searchZy": this.searchZyId
                            }
                        }).then((res) => {
                            this.majorList = res.data.data.mntbList;
                            this.condition.total = res.data.data.count;
                        }, function (error) {
                            alert("系统异常，请先联系管理员");
                        });
                    } else if (this.queryMethod == "xiShu") {
                        if (this.button1 == "保底") {
                            fz1 = 0.01;
                            fz2 = 0.02;
                        } else if (this.button1 == "适合") {
                            fz1 = 0;
                            fz2 = 0.01;
                        } else if (this.button1 == "风险") {
                            fz1 = -0.01;
                            fz2 = 0;
                        }
                        else if (this.button1 == "冲刺") {
                            fz1 = -0.02;
                            fz2 = -0.01;
                        }
                        exam.getVolByDiff_post({
                            "data": {
                                "fz1": fz1,
                                "fz2": fz2,
                                "pageNum": pageNum,
                                "pageSize": pageSize,
                                "search1": search1,
                                "searchType": this.condition.filter.searchType,
                                "searchValue": this.condition.filter.searchValue,
                                "searchZy": this.searchZyId
                            }
                        }).then((res) => {
                            this.majorList = res.data.data.mntbList;
                            this.condition.total = res.data.data.count;
                        }, function (error) {
                            alert("系统异常，请先联系管理员");
                        });
                    } else if (this.queryMethod == "leiBi") {
                        if (this.condition.leiBi.tongFen.length > 0 || this.condition.leiBi.tongMing.length > 0) {
                            exam.getVolByLb_post({
                                "data": {
                                    "fz1": this.condition.leiBi.tongFen.toString(),
                                    "fz2": this.condition.leiBi.tongMing.toString(),
                                    "pageNum": pageNum,
                                    "pageSize": pageSize,
                                    "search1": search1,
                                    "searchType": this.condition.filter.searchType,
                                    "searchValue": this.condition.filter.searchValue,
                                    "searchZy": this.searchZyId
                                }
                            }).then((res) => {

                                this.majorList = res.data.data.mntbList;
                                this.condition.total = res.data.data.count;

                            }, function (error) {
                                alert("系统异常，请先联系管理员");
                            });
                        }

                    }

                } else {
                    if (this.queryMethod == "xianCha") {
                        exam.getVolByXc_post({
                            "data": {
                                "fz1": fz1,
                                "fz2": fz2,
                                "pageNum": pageNum,
                                "pageSize": pageSize,
                                "search1": search1,
                                "searchType": this.condition.filter.searchType,
                                "searchValue": this.condition.filter.searchValue,
                                "searchZy": this.searchZyId
                            }
                        }).then((res) => {
                            this.majorList = res.data.data.mntbList;
                            this.condition.total = res.data.data.count;
                        }, function (error) {
                            alert("系统异常，请先联系管理员");
                        });
                    } else if (this.queryMethod == "weiCi") {
                        exam.getVolByPm_post({
                            "data": {
                                "fz1": fz1,
                                "fz2": fz2,
                                "pageNum": pageNum,
                                "pageSize": pageSize,
                                "search1": search1,
                                "searchType": this.condition.filter.searchType,
                                "searchValue": this.condition.filter.searchValue,
                                "searchZy": this.searchZyId
                            }
                        }).then((res) => {
                            this.majorList = res.data.data.mntbList;
                            this.condition.total = res.data.data.count;
                        }, function (error) {
                            alert("系统异常，请先联系管理员");
                        });
                    } else if (this.queryMethod == "xiShu") {
                        exam.getVolByDiff_post({
                            "data": {
                                "fz1": fz1,
                                "fz2": fz2,
                                "pageNum": pageNum,
                                "pageSize": pageSize,
                                "search1": search1,
                                "searchType": this.condition.filter.searchType,
                                "searchValue": this.condition.filter.searchValue,
                                "searchZy": this.searchZyId
                            }
                        }).then((res) => {
                            this.majorList = res.data.data.mntbList;
                            this.condition.total = res.data.data.count;
                        }, function (error) {
                            alert("系统异常，请先联系管理员");
                        });
                    } else if (this.queryMethod == "leiBi") {
                        if (this.condition.leiBi.tongFen.length > 0 || this.condition.leiBi.tongMing.length > 0) {
                            exam.getVolByLb_post({
                                "data": {
                                    "fz1": this.condition.leiBi.tongFen.toString(),
                                    "fz2": this.condition.leiBi.tongMing.toString(),
                                    "pageNum": pageNum,
                                    "pageSize": pageSize,
                                    "search1": search1,
                                    "searchType": this.condition.filter.searchType,
                                    "searchValue": this.condition.filter.searchValue,
                                    "searchZy": this.searchZyId
                                }
                            }).then((res) => {
                                this.majorList = res.data.data.mntbList;
                                this.condition.total = res.data.data.count;
                            }, function (error) {
                                alert("系统异常，请先联系管理员");
                            });
                        }

                    }


                }
                for(var i in this.majorList){
                    this.majorList[i].className = "chongci";
                }
            },
            weiciChangeSlider(value) {
                this.condition.current = 1;
                this.condition.pageSize = 20;
                this.xianchaChange(value, value, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            xishuChangeSlider(value) {
                this.condition.current = 1;
                this.condition.pageSize = 20;
                this.xianchaChange(value / 100, value / 100, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);

            },
            tableChange() {
                this.condition.current = 1;
                this.condition.pageSzie = 20;
                this.condition.total = 0;
                this.majorList = null;
                this.condition.xiShu = 0;
                this.condition.weiCi.diFen = 0;
                this.condition.xianca = 0;
                this.condition.leiBi.tongMing = [];
                this.condition.leiBi.tongFen = [];
                this.xianchaChange(this.condition.xianca, this.condition.xianca, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            xianchaChangeSlider(value) {
                this.condition.current = 1;
                this.condition.pageSize = 20;

                this.xianchaChange(value, value, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            searchChange(value, selectedData) {
                if (value.length > 0) {
                    this.condition.filter.searchType = value.length;
                    this.condition.filter.searchValue = value[value.length - 1];
                } else {
                    this.condition.filter.searchType = 0;
                    this.condition.filter.searchValue = "";
                }
                this.condition.current = 1;
                this.condition.pageSize = 20;

                this.xianchaChange(this.condition.xianca, this.condition.xianca, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            searchChange1() {
                this.condition.current = 1;
                this.condition.pageSize = 20;
                this.xianchaChange(this.condition.xianca, this.condition.xianca, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            lbScoreChangeSilder(value) {
                console.info(value);
                this.condition.current = 1;
                this.condition.pageSize = 20;
                this.xianchaChange(value.toString(), this.condition.leiBi.tongMing.toString(), this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);

            },
            lbPmChangeSilder(value) {
                console.info(value);
                this.condition.current = 1;
                this.condition.pageSize = 20;
                this.xianchaChange(this.condition.leiBi.tongFen.toString(), value.toString(), this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);

            },
            pageChange(current) {
                this.condition.current = current;
                this.xianchaChange(this.condition.xianca, this.condition.xianca, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            pageSizeChange(pageSize) {
                this.condition.pageSzie = pageSize;
                this.xianchaChange(this.condition.xianca, this.condition.xianca, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            addToFavorite(major) {
                exam.addCollection_post({"data": {"mntbId": major.id}}).then((res) => {
                    if (res.data.resCode == 0) {
                        major.isFavorite = !major.isFavorite;
                        if (major.isFavorite) {
                            var msg = "<h2>添加收藏</h2>" + major.martichSchoolName + " 的 " + major.professionName;
                        } else {
                            var msg = "<h2>取消收藏</h2>" + major.martichSchoolName + " 的 " + major.professionName;
                        }
                        this.$Message.success(msg);
                    }
                }, function (error) {
                    alert("系统异常，请先联系管理员");
                });


            },
            changeGroup(data) {
                this.showload();
                this.oneItems = [];
                exam.getInitZyByCate_post({"data": {"type": data.toString()}}).then((res) => {
                    this.oneItems = res.data.data.resultList;
                    this.$Spin.hide()
                }, function (error) {
                    alert("系统异常，请先联系管理员");
                    this.$Spin.hide()
                });
            },
            changeGroup1(data) {
                this.showload();
                this.oneItems1 = [];
                exam.getInitZyByCate_post({"data": {"type": data.toString()}}).then((res) => {
                    this.oneItems1 = res.data.data.resultList;
                    this.$Spin.hide()
                }, function (error) {
                    alert("系统异常，请先联系管理员");
                    this.$Spin.hide()
                });
            },
            /* handleCheckAll1(index) {
                 let oneItems = this.oneItems1[index];
                 if (oneItems.indeterminate) {
                     oneItems.checkAll = false;
                     for (var i = 0; i < oneItems.twoItems.length; i++) {
                         oneItems.twoItems[i].checkAll = false;
                     }
                 } else {
                     oneItems.checkAll = !oneItems.checkAll;
                     for (var i = 0; i < oneItems.twoItems.length; i++) {
                         oneItems.twoItems[i].checkAll = oneItems.checkAll;
                     }
                 }
                 oneItems.indeterminate = false;
                 for (var i = 0; i < oneItems.twoItems.length; i++) {
                     oneItems.twoItems[i].indeterminate = false;
                 }
                 if (oneItems.checkAll) {
                     oneItems.twoItemCheck = oneItems.twoItemCheckAll;
                     for (var i = 0; i < oneItems.twoItems.length; i++) {
                         oneItems.twoItems[i].threeItemCheck = oneItems.twoItems[i].threeItemCheckAll;
                     }
                 } else {
                     oneItems.twoItemCheck = [];
                     for (var i = 0; i < oneItems.twoItems.length; i++) {
                         oneItems.twoItems[i].threeItemCheck = [];
                     }
                 }
             },
             handleCheckAllTwo1(index, twoIndex) {

                 let twoItems = this.oneItems1[index].twoItems[twoIndex];

                 if (twoItems.indeterminate) {
                     twoItems.checkAll = false;
                 } else {
                     twoItems.checkAll = !twoItems.checkAll;
                 }
                 twoItems.indeterminate = false;

                 if (twoItems.checkAll) {
                     twoItems.threeItemCheck = twoItems.threeItemCheckAll;
                 } else {
                     twoItems.threeItemCheck = [];
                 }

             },
             checkAllGroupChange1(index, twoIndex, threeIndex) {
                 let oneItems = this.oneItems1[index];

                 let twoItems = oneItems.twoItems[twoIndex];
                 if (twoItems.threeItemCheck.length === twoItems.threeItemCheck.length) {
                     twoItems.indeterminate = false;
                     twoItems.checkAll = true;
                 } else if (twoItems.threeItemCheck.length > 0) {
                     twoItems.indeterminate = true;
                     twoItems.checkAll = false;
                 } else {
                     twoItems.indeterminate = false;
                     twoItems.checkAll = false;
                 }
             },
             handleCheckAll(index) {
                 let oneItems = this.oneItems[index];
                 if (oneItems.indeterminate) {
                     oneItems.checkAll = false;
                     for (var i = 0; i < oneItems.twoItems.length; i++) {
                         oneItems.twoItems[i].checkAll = false;
                     }
                 } else {
                     oneItems.checkAll = !oneItems.checkAll;
                     for (var i = 0; i < oneItems.twoItems.length; i++) {
                         oneItems.twoItems[i].checkAll = oneItems.checkAll;
                     }
                 }
                 oneItems.indeterminate = false;
                 for (var i = 0; i < oneItems.twoItems.length; i++) {
                     oneItems.twoItems[i].indeterminate = false;
                 }
                 if (oneItems.checkAll) {
                     oneItems.twoItemCheck = oneItems.twoItemCheckAll;
                     for (var i = 0; i < oneItems.twoItems.length; i++) {
                         oneItems.twoItems[i].threeItemCheck = oneItems.twoItems[i].threeItemCheckAll;
                     }
                 } else {
                     oneItems.twoItemCheck = [];
                     for (var i = 0; i < oneItems.twoItems.length; i++) {
                         oneItems.twoItems[i].threeItemCheck = [];
                     }
                 }
             },
             handleCheckAllTwo(index, twoIndex) {

                 let twoItems = this.oneItems[index].twoItems[twoIndex];

                 if (twoItems.indeterminate) {
                     twoItems.checkAll = false;
                 } else {
                     twoItems.checkAll = !twoItems.checkAll;
                 }
                 twoItems.indeterminate = false;

                 if (twoItems.checkAll) {
                     twoItems.threeItemCheck = twoItems.threeItemCheckAll;
                 } else {
                     twoItems.threeItemCheck = [];
                 }

             },
             checkAllGroupChange(index, twoIndex, threeIndex) {
                 let oneItems = this.oneItems[index];

                 let twoItems = oneItems.twoItems[twoIndex];
                 if (twoItems.threeItemCheck.length === twoItems.threeItemCheck.length) {
                     twoItems.indeterminate = false;
                     twoItems.checkAll = true;
                 } else if (twoItems.threeItemCheck.length > 0) {
                     twoItems.indeterminate = true;
                     twoItems.checkAll = false;
                 } else {
                     twoItems.indeterminate = false;
                     twoItems.checkAll = false;
                 }
             },*/
            change(status) {
                this.status = status
                this.condition.current = 1;
                this.condition.pageSize = 20;
                this.condition.xiShu = 0;
                this.condition.weiCi.diFen = 0;
                this.condition.xianca = 0;
                this.$Message.success('开关状态：' + status);
                this.xianchaChange(0, 0, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            change1(status) {
                this.condition.current = 1;
                this.condition.pageSize = 20;
                this.xianchaChange(0, 0, this.condition.current - 1, this.condition.pageSzie, this.condition.filter.type);
            },
            show(index) {
                this.$Modal.info({
                    title: 'User Info',
                    content: `Name：${this.data6[index].name}<br>Age：${this.data6[index].age}<br>Address：${this.data6[index].address}`
                })
            },
            remove(index) {
                this.data6.splice(index, 1);
            },

        },
        mounted() {
            this.xianchaChange(this.condition.xianca, this.condition.xianca, this.condition.pageNum - 1, this.condition.pageSzie, this.condition.filter.type);
        }
    }
</script>

<style>
    .yuzhi {
        font-size: 20px;
    }

    .chongci {
        color: red;
    }

    .wentuo {
        color: yellow;
    }

    .baodi {
        color: blue;
    }
</style>
